package com.example.factory;

import com.example.factory.abstractfactory.DemoFactory;
import com.example.factory.abstractfactory.impl.NowFactory;
import com.example.factory.behavior.Food;
import com.example.factory.behavior.Vehicle;
import com.example.factory.behavior.Weapon;

public class Main {
    public static void main(String[] args) {
        DemoFactory demoFactory=new NowFactory();
        Food food = demoFactory.createFood();
        food.eat();
        Vehicle vehicle = demoFactory.createVehicle();
        vehicle.go();
        Weapon weapon = demoFactory.createWeapon();
        weapon.shoot();
    }
}
